﻿#include "pch.h"

void WoOutgoingBody::declareHeaders(Headers& headers) {
	return;
}
p_char8 WoOutgoingBody::getKnownData() {
	return (p_char8)&m_data[0];
}

v_int64 WoOutgoingBody::getKnownSize() {
	return m_data.size();
}

oatpp::v_io_size WoOutgoingBody::read(void* buffer, v_buff_size count, oatpp::async::Action& action) {
	v_buff_size lcount=(m_data.size() > count)? count: m_data.size();
	memcpy_s((void*)&m_data[0], lcount, buffer, count);
	return lcount;
}

void WoOutgoingBody::AddByte(const char* data, UINT size) {
	m_data.insert(m_data.end(),data, data+ size);
}

UINT WoOutgoingBody::size() {
	return m_data.size();
}